<template>
  <div>
    <detail-banner
      :sightName="sightName"
      :bannerImg="bannerImg"
      :bannerImgs="gallaryImgs"
    ></detail-banner>
    <detail-header></detail-header>
    <div class="content">
      <detail-list :list="list"></detail-list>
    </div>
  </div>
</template>

<script>
import DetailBanner from '../components/detail/Banner.vue'
import DetailHeader from '../components/detail/Header.vue'
import DetailList from '../components/detail/List.vue'
import axios from 'axios'
export default {
  name: 'Detail',
  components: {
    DetailBanner,
    DetailHeader,
    DetailList
  },
  data () {
    return {
      sightName: '',
      bannerImg: '',
      gallaryImgs: [],
      list: []
    }
  },
  methods: {
    async getDetailInfo () {
      const{ data: { data: res } } = await axios.get('/api/detail.json',
      { params: { id: this.$route.params.id } })
        this.sightName = res.sightName
        this.bannerImg = res.bannerImg
        this.gallaryImgs = res.gallaryImgs
        this.list = res.categoryList
    }
  },
  /* mounted() {
      
      this.getDetailInfo()
  }, */
  activated () {
      /* console.log(this.$router.params) */
      this.getDetailInfo()
  }
}
</script>

<style lang="stylus" scoped>
  .content
    height: 15rem
</style>
